package com.itheima.others;




   public class Test {
        public static void main(String[] args) {
            class dog implements Animal{            //接口实现类

                @Override
                public void show() {
                    System.out.println("子类的形式被调用");
                }
            }
            fun(new dog());//请用子类的形式调用
            fun(new Animal() {
                @Override
                public void show() {
                    System.out.println("匿名内部类的形式调用");
                }
            });//请用匿名内部类的形式调用
        }

        public static void fun(Animal a) {
            a.show();
        }
    }



interface Animal {
    public void show();
}
